package org.ngbx.demo.flink.clickevent;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserClickedEvent {
    private Long userId;

    private Long occurrenceTime;

    @Override
    public String toString() {
        return this.getClass().getSimpleName() + "{" +
                "userId='" + userId + '\'' +
                ", occurrenceTime='" + LocalDateTime.ofInstant(Instant.ofEpochMilli(occurrenceTime), ZoneId.systemDefault()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"))
                + '\'' +
                '}';
    }
}
